import 'package:flutter/material.dart';
import 'package:flutter_enjoy_plus_seven/pages/tabs_page.dart';

class NotFound extends StatelessWidget {
  const NotFound({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const Icon(
              Icons.error,
              size: 100,
              color: Colors.grey,
            ),
            const Text(
              '页面不存在',
              style: TextStyle(fontSize: 20),
            ),
            TextButton(
              onPressed: () {
                // 替换成首页
                Navigator.pushAndRemoveUntil(
                  context,
                  MaterialPageRoute(builder: (context) => const TabsPage()),
                  (route) => false,
                );
              },
              child: const Text('返回首页'),
            )
          ],
        ),
      ),
    );
  }
}
